home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 25
/
Cream of the Crop 25.iso
/
doom
/
knbot03.zip
/
SRC.ZIP
/
BOT.QC
< prev
next >
Wrap
Text File
|
1997-03-12
|
6KB
|
198 lines
/*
==============================================================================
KN BOT - version 0.2
==============================================================================
*/
// Prototypes
void () Bot_Precache;
void (string name, string yn) BotCreate;
void (vector org) spawn_tfog;
//=============================================================
// Bot_Precache - called by Worldspawn
//=============================================================
void () Bot_Precache =
{
};
//=============================================================
// BotActivate - Activates the bot
//=============================================================
void (string name, string yn) BotCreate =
{
// sounds and models precached in the world.qc file
local entity newbot;
local entity spot;
local float r;
r = random ();
newbot = spawn();
newbot.solid = SOLID_SLIDEBOX;
newbot.movetype = MOVETYPE_STEP;
newbot.netname = name;
//newbot.cnetname = color; // added color
// BG Bot - Trying to get it to print Bot kills in Rankings.
newbot.cl = "client";
newbot.classname = "bot";
newbot.health = 100;
newbot.max_health = 100;
if (teamplay)
newbot.team = self.team;
newbot.frags = 0;
newbot.flags = FL_CLIENT;
newbot.colormap = 0;
bprint(ftos(self.colormap));
newbot.takedamage = DAMAGE_AIM;
newbot.goalentity = self;
newbot.movetarget = self;
newbot.pausetime = 1 + 1*random();
newbot.deadflag = DEAD_NO;
newbot.ideal_yaw = newbot.angles * '0 1 0';
newbot.yaw_speed = 75;
newbot.items = IT_AXE | IT_SHOTGUN;
newbot.show_hostile = 0;
newbot.weapon = 1;
newbot.effects = 0;
newbot.ammo_shells = 25;
newbot.view_ofs = '0 0 25';
newbot.th_xstand = bot_xstand1; // axe
newbot.th_stand = bot_stand1;
newbot.th_xwalk = bot_xwalk1; // axe
newbot.th_walk = bot_walk1;
newbot.th_xstuff = bot_xstuff1; // axe
newbot.th_stuff = bot_stuff1;
newbot.th_xrun = bot_xrun1; // axe
newbot.th_run = bot_run1;
newbot.th_xpain = bot_xpain1; // axe
newbot.th_pain = bot_pain;
newbot.th_xdie = bot_xdie1; // axe
newbot.th_die = bot_die;
//newbot.th_xmissile = bot_xatk1; // axe - removed because it was stopping the bot
//newbot.th_missile = bot_atk1; // removed
setmodel (newbot, "progs/player.mdl");
setsize (newbot, VEC_HULL_MIN, VEC_HULL_MAX);
// BG Bot - begin select a spot to spawn bot
// if not deathmatch or coop. starts bot in players starting points
spot = SelectSpawnPoint ();
newbot.origin = spot.origin + '0 0 1';
newbot.angles = spot.angles;
// BG Bot - end select a spot to spawn bot
spawn_tfog (newbot.origin);
bprint(newbot.netname);
bprint(" entered the game\n");
newbot.nextthink = time + 0.05;
newbot.think = newbot.th_stand;
spawn_tdeath(newbot.origin, newbot);
// skin
newbot.skin = 24*random();
/*
if (skin1 == 0) skin1 = newbot.skin;
else if (skin2 == 0) skin2 = newbot.skin;
else if (skin3 == 0) skin3 = newbot.skin;
else if (skin4 == 0) skin4 = newbot.skin;
else if (skin5 == 0) skin5 = newbot.skin;
else if (skin6 == 0) skin6 = newbot.skin;
else if (skin7 == 0) skin7 = newbot.skin;
else if (skin8 == 0) skin8 = newbot.skin;
*/
// roaming AI
newbot.fl_lead = FALSE;
// name for messages
newbot.yname = yn;
};
void () botrespawn =
{
local entity spot;
//self.nextthink = time + 10;
self.solid = SOLID_SLIDEBOX;
self.movetype = MOVETYPE_STEP;
self.flags = FL_CLIENT;
self.colormap = 0;
self.classname = "bot";
self.health = 100;
self.max_health = 100;
self.takedamage = DAMAGE_AIM;
self.deadflag = DEAD_NO;
self.goalentity = self;
self.movetarget = self;
self.pausetime = 0.5 + 1*random();
self.ideal_yaw = self.angles * '0 1 0';
self.yaw_speed = 75;
self.show_hostile = 0;
self.effects = 0;
self.view_ofs = '0 0 25';
self.items = IT_AXE | IT_SHOTGUN;
self.weapon = 1;
self.ammo_shells = 25;
self.ammo_nails = 0;
self.ammo_rockets = 0;
self.ammo_cells = 0;
self.th_xstand = bot_xstand1; // axe
self.th_stand = bot_stand1;
self.th_xwalk = bot_xwalk1; // axe
self.th_walk = bot_walk1;
self.th_xstuff = bot_xstuff1; // axe
self.th_stuff = bot_stuff1;
self.th_xrun = bot_xrun1; // axe
self.th_run = bot_run1;
self.th_xpain = bot_xpain1; // axe
self.th_pain = bot_pain;
self.th_xdie = bot_xdie1; // axe
self.th_die = bot_die;
//self.th_xmissile = bot_xatk1; // axe
//self.th_missile = bot_atk1;
self.nextthink = time + 5;
setmodel (self, "progs/player.mdl");
setsize (self, VEC_HULL_MIN, VEC_HULL_MAX);
spot = SelectSpawnPoint();
setorigin(self, spot.origin);
self.angles = spot.angles;
spawn_tfog (self.origin);
spawn_tdeath(self.origin, self);
self.nextthink = time + 0.05;
self.think = self.th_stand;
// skin
self.skin = ddskin; // copy old skin (has problems)
/*if (skin1 > 0) self.skin = skin1;
else if (skin2 > 0) self.skin = skin2;
else if (skin3 > 0) self.skin = skin3;
else if (skin4 > 0) self.skin = skin4;
else if (skin5 > 0) self.skin = skin5;
else if (skin6 > 0) self.skin = skin6;
else if (skin7 > 0) self.skin = skin7;
else if (skin8 > 0) self.skin = skin8;*/
// roaming AI
self.fl_lead = FALSE;
// messages name
self.yname = ddyn;
};
void() BotLeave =
{
bprint("bot");
bprint(" left the game with frags\n");
};